bitkeeper revision 1.1509.1.2 (429261a0Qv1Wip4lt2f2ekcSvhVyxA)
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Mon, 23 May 2005 23:05:04 +0000 (23:05 +0000)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Mon, 23 May 2005 23:05:04 +0000 (23:05 +0000)
Fix multi-domain scheduling bug
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>

xen/arch/ia64/Makefile
xen/arch/ia64/domain.c
xen/arch/ia64/hypercall.c
xen/arch/ia64/patch/linux-2.6.11/entry.S
xen/arch/ia64/tools/mkbuildtree
xen/arch/ia64/vcpu.c
xen/arch/ia64/xenmisc.c

index fdb9fbe1b9d0c7dd5bf8a4f906a6a0d9ae4b263f..bfe11cb49cfb8a4bf86ab17da44b39d76403535b 100644 (file)
@@ -29,6 +29,9 @@ default: $(OBJS) head.o ia64lib.o xen.lds.s
        $(LD) $(LDFLAGS) -T $(BASEDIR)/arch/$(TARGET_ARCH)/xen.lds.s -N \
                -Map map.out head.o $(ALL_OBJS) -o $(TARGET)-syms
        $(OBJCOPY) -R .note -R .comment -S $(TARGET)-syms $(TARGET)
+       $(NM) -n $(TARGET)-syms | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)'\
+                > $(BASEDIR)/System.map
+
 
 asm-offsets.s: asm-offsets.c $(BASEDIR)/include/asm-ia64/.offsets.h.stamp
        $(CC) $(CFLAGS) -S -o $@ $<
index 8f12179c5dfba361d5096fc733513550f2044850..66559c29314f15dc212b4980acd1ec6039c8eab9 100644 (file)
@@ -116,6 +116,7 @@ void continue_cpu_idle_loop(void)
 #endif
            while ( !softirq_pending(cpu) )
                default_idle();
+           raise_softirq(SCHEDULE_SOFTIRQ);
            do_softirq();
        }
 }
index 3eeff6fe2bd8569a30e5a165abf252f387d4e9cf..adaf7d3b441648a65b4d0e4656346b283e403fe3 100644 (file)
@@ -41,6 +41,10 @@ ia64_hypercall (struct pt_regs *regs)
                ed->vcpu_info->arch.pending_interruption = 1;
 #endif
                x = pal_emulator_static(regs->r28);
+               if (regs->r28 == PAL_HALT_LIGHT) {
+                       do_sched_op(SCHEDOP_yield);
+                       //break;
+               }
                regs->r8 = x.status; regs->r9 = x.v0;
                regs->r10 = x.v1; regs->r11 = x.v2;
                break;
index 9f860edc4f416928127fc01a151accb9d7b19156..2b7f690aa829a1fe456b42564444c1ad6017b432 100644 (file)
@@ -1,5 +1,5 @@
---- /home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/arch/ia64/kernel/entry.S      2005-03-01 23:37:50.000000000 -0800
-+++ /home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/arch/ia64/entry.S        2005-05-18 12:40:51.000000000 -0700
+--- ../../linux-2.6.11/arch/ia64/kernel/entry.S        2005-03-02 00:37:50.000000000 -0700
++++ arch/ia64/entry.S  2005-05-23 16:49:23.000000000 -0600
 @@ -46,6 +46,7 @@
  
  #include "minstate.h"
        ;;                                      // added stop bits to prevent r8 dependency
  END(ia64_ret_from_clone)
        // fall through
-@@ -700,19 +732,25 @@
+@@ -700,19 +732,27 @@
  .work_processed_syscall:
        adds r2=PT(LOADRS)+16,r12
        adds r3=PT(AR_BSPSTORE)+16,r12
-+#ifndef XEN
++#ifdef XEN
++      ;;
++#else
        adds r18=TI_FLAGS+IA64_TASK_SIZE,r13
        ;;
  (p6)  ld4 r31=[r18]                           // load current_thread_info()->flags
        ;;
        // start restoring the state saved on the kernel stack (struct pt_regs):
        ld8 r9=[r2],PT(CR_IPSR)-PT(R9)
-@@ -757,7 +795,11 @@
+@@ -757,7 +797,11 @@
        ;;
        ld8.fill r12=[r2]       // restore r12 (sp)
        ld8.fill r15=[r3]       // restore r15
        ;;
  (pUStk)       ld4 r3=[r3]             // r3 = cpu_data->phys_stacked_size_p8
  (pUStk) st1 [r14]=r17
-@@ -814,9 +856,18 @@
+@@ -814,9 +858,18 @@
  (pUStk)       cmp.eq.unc p6,p0=r0,r0          // p6 <- pUStk
  #endif
  .work_processed_kernel:
        adds r21=PT(PR)+16,r12
        ;;
  
-@@ -828,17 +879,20 @@
+@@ -828,17 +881,20 @@
        ld8 r28=[r2],8          // load b6
        adds r29=PT(R24)+16,r12
  
        ;;
        ld8 r31=[r2],16         // load ar.ssd
        ld8.fill r8=[r3],16
-@@ -934,7 +988,11 @@
+@@ -934,7 +990,11 @@
        shr.u r18=r19,16        // get byte size of existing "dirty" partition
        ;;
        mov r16=ar.bsp          // get existing backing store pointer
        ;;
        ld4 r17=[r17]           // r17 = cpu_data->phys_stacked_size_p8
  (pKStk)       br.cond.dpnt skip_rbs_switch
-@@ -1069,6 +1127,7 @@
+@@ -1069,6 +1129,7 @@
        mov pr=r31,-1           // I0
        rfi                     // B
  
        /*
         * On entry:
         *      r20 = &current->thread_info->pre_count (if CONFIG_PREEMPT)
-@@ -1130,6 +1189,7 @@
+@@ -1130,6 +1191,7 @@
        ld8 r8=[r2]
        ld8 r10=[r3]
        br.cond.sptk.many .work_processed_syscall       // re-check
  
  END(ia64_leave_kernel)
  
-@@ -1166,6 +1226,7 @@
+@@ -1166,6 +1228,7 @@
        br.ret.sptk.many rp
  END(ia64_invoke_schedule_tail)
  
        /*
         * Setup stack and call do_notify_resume_user().  Note that pSys and pNonSys need to
         * be set up by the caller.  We declare 8 input registers so the system call
-@@ -1264,6 +1325,7 @@
+@@ -1264,6 +1327,7 @@
        mov ar.unat=r9
        br.many b7
  END(sys_rt_sigreturn)
  
  GLOBAL_ENTRY(ia64_prepare_handle_unaligned)
        .prologue
-@@ -1278,6 +1340,7 @@
+@@ -1278,6 +1342,7 @@
        br.cond.sptk.many rp                            // goes to ia64_leave_kernel
  END(ia64_prepare_handle_unaligned)
  
        //
        // unw_init_running(void (*callback)(info, arg), void *arg)
        //
-@@ -1585,3 +1648,4 @@
+@@ -1585,3 +1650,4 @@
        data8 sys_ni_syscall
  
        .org sys_call_table + 8*NR_syscalls     // guard against failures to increase NR_syscalls
index f9b58527dd63947b3cb81cfff1ea5090f8344ee5..15a6d937cab54a3777627f8991b74278ee5143c6 100644 (file)
@@ -307,7 +307,6 @@ softlink include/linux/timex.h include/asm-ia64/linux/timex.h
 softlink include/linux/topology.h include/asm-ia64/linux/topology.h
 softlink include/linux/seqlock.h include/asm-ia64/linux/seqlock.h
 softlink include/linux/jiffies.h include/asm-ia64/linux/jiffies.h
-softlink include/linux/jiffies.h include/asm-ia64/linux/jiffies.h
 
 null include/asm-ia64/linux/file.h
 null include/asm-ia64/linux/module.h
index 863c99beb3c540fd7687fa9933a934382877d01c..61f369e40156a8667c942adcce5b3345081eb7b4 100644 (file)
@@ -638,7 +638,15 @@ IA64FAULT vcpu_get_ivr(VCPU *vcpu, UINT64 *pval)
 {
        int i;
        UINT64 vector, mask;
-#if 1
+
+#define HEARTBEAT_FREQ 16      // period in seconds
+#ifdef HEARTBEAT_FREQ
+#define N_DOMS 16      // period in seconds
+       static long count[N_DOMS] = { 0 };
+       REGS *regs = vcpu_regs(vcpu);
+       unsigned domid = vcpu->domain->domain_id;
+#endif
+#ifdef IRQ_DEBUG
        static char firstivr = 1;
        static char firsttime[256];
        if (firstivr) {
@@ -654,9 +662,21 @@ IA64FAULT vcpu_get_ivr(VCPU *vcpu, UINT64 *pval)
                *pval = vector;
                return IA64_NO_FAULT;
        }
+#ifdef HEARTBEAT_FREQ
+       if (domid >= N_DOMS) domid = N_DOMS-1;
+       if (vector == (PSCB(vcpu,itv) & 0xff) &&
+           !(++count[domid] & ((HEARTBEAT_FREQ*1024)-1))) {
+               printf("Dom%d heartbeat... iip=%p,psr.i=%d,pend=%d\n",
+                       domid, regs->cr_iip,
+                       current->vcpu_info->arch.interrupt_delivery_enabled,
+                       current->vcpu_info->arch.pending_interruption);
+               count[domid] = 0;
+               dump_runq();
+       }
+#endif
        // now have an unmasked, pending, deliverable vector!
        // getting ivr has "side effects"
-#if 0
+#ifdef IRQ_DEBUG
        if (firsttime[vector]) {
                printf("*** First get_ivr on vector=%d,itc=%lx\n",
                        vector,ia64_get_itc());
@@ -989,6 +1009,10 @@ IA64FAULT vcpu_set_itc(VCPU *vcpu, UINT64 val)
 
        UINT64 newnow = val, min_delta;
 
+#define DISALLOW_SETTING_ITC_FOR_NOW
+#ifdef DISALLOW_SETTING_ITC_FOR_NOW
+printf("vcpu_set_itc: Setting ar.itc is currently disabled\n");
+#else
        local_irq_disable();
        if (olditm) {
 printf("**** vcpu_set_itc(%lx): vitm changed to %lx\n",val,newnow+d);
@@ -1008,6 +1032,7 @@ printf("**** vcpu_set_itc(%lx): vitm changed to %lx\n",val,newnow+d);
                //using_xen_as_itm++;
        }
        local_irq_enable();
+#endif
        return (IA64_NO_FAULT);
 }
 
index 142cbfcb2619f3fdeaeddb581dab894db27cd738..c4630bd7fd9ff6f78c06122d3de0cd64c13b74b4 100644 (file)
@@ -262,8 +262,8 @@ void context_switch(struct exec_domain *prev, struct exec_domain *next)
 static long cnt[16] = { 50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50};
 static int i = 100;
 int id = ((struct exec_domain *)current)->domain->domain_id & 0xf;
-if (!cnt[id]--) { printk("%x",id); cnt[id] = 50; }
-if (!i--) { printk("+",id); cnt[id] = 100; }
+if (!cnt[id]--) { printk("%x",id); cnt[id] = 500; }
+if (!i--) { printk("+",id); cnt[id] = 1000; }
 }
        clear_bit(_VCPUF_running, &prev->vcpu_flags);
        //if (!is_idle_task(next->domain) )
@@ -273,7 +273,10 @@ if (!i--) { printk("+",id); cnt[id] = 100; }
                vmx_load_all_rr(current);
        return;
 #else // CONFIG_VTI
-       load_region_regs(current);
+       if (!is_idle_task(current->domain)) {
+               load_region_regs(current);
+               if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
+       }
        if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
 #endif // CONFIG_VTI
 }